Suppress false-positive CodeQL warning in RemoteOrchestrationServiceClient#1347
Suppress false-positive CodeQL warning in RemoteOrchestrationServiceClient#1347
Conversation
…nAsync method Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate a reported false-positive CodeQL warning in the Azure Service Fabric remote orchestration client by adding targeted suppressions and documenting why TypeNameHandling.All is used on the request serialization path.
Changes:
- Added
SuppressMessageattributes for CA2326/CA2327 aroundPutJsonAsync. - Added an inline comment describing why the
JsonMediaTypeFormatterusesTypeNameHandling.Alland why the finding is considered a false positive. - Added
System.Diagnostics.CodeAnalysisimport to support the suppressions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // CodeQL [SM02211] False positive: serialization (write) path only; no untrusted JSON is deserialized here. | ||
| SerializerSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All } | ||
| }; |
There was a problem hiding this comment.
This comment doesn’t appear to use a suppression syntax that GitHub CodeQL recognizes (e.g., lgtm[cs/<query-id>] / codeql[cs/<query-id>] style), so it may not actually suppress the alert that prompted this PR. If the goal is suppression (not just justification), use the repository’s supported CodeQL inline suppression mechanism or adjust the CodeQL configuration/queries to ignore this specific finding, and reference the query id that maps to SM02211.
Resolves https://msazure.visualstudio.com/Antares/_workitems/edit/37181654